package com.demo2do.fms.admin.service.business;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.demo2do.core.entity.page.Page;
import com.demo2do.fms.admin.dto.OtherFeeInfo;
import com.demo2do.fms.admin.entity.report.business.DispatchOrderReportSearch;
import com.demo2do.fms.admin.entity.report.business.TransOrderReportSearch;
import com.demo2do.fms.admin.entity.search.business.DispatchOrderSearch;
import com.demo2do.fms.admin.entity.search.business.TransOrderSearch;
import com.demo2do.fms.admin.entity.security.Login;
import com.demo2do.fms.entity.business.shipment.DispatchOrder;
import com.demo2do.fms.entity.business.shipment.DispatchOrderRecord;
import com.demo2do.fms.entity.business.shipment.TransportCost;
import com.demo2do.fms.entity.data.business.OtherFeeType;

/**
 * 
 * @author Ysy
 *
 */
public interface DispatchOrderService {
    
    /**
     * 派车单查询
     * 
     * @param dispatchOrderSearch
     * @return
     */
    public int countDispatch(DispatchOrderSearch dispatchOrderSearch);
    
    /**
     * 派车单查询
     * 
     * @param dispatchOrderSearch
     * @param page
     * @return
     */
    public List<DispatchOrder> listDispatch(DispatchOrderSearch dispatchOrderSearch, Page page);
    
    /**
     * 回单确认查询
     * 
     * @param search
     * @return
     */
    public int countTransOrder(TransOrderSearch search);
    
    /**
     * 回单确认查询
     * 
     * @param search
     * @param page
     * @return
     */
    public List<DispatchOrder> listTransOrder(TransOrderSearch search, Page page);
    
    /**
     * list dispatch_order by dispatch_order_ids(用于删除派车单)
     * 
     * @param dispatchOrderIds
     * @return
     */
    public List<DispatchOrder> listDispatchOrder(List<Long> dispatchOrderIds);
    
    /**
     * load dispatch_order by ID
     * 
     * @param id
     * @return
     */
    public DispatchOrder loadDispatchOrder(Long id);
    
    /**
     * load dispatch_order by load_group_number
     * 
     * @param loadGroupNumber
     * @return
     */
    public DispatchOrder loadDispatchOrder(String loadGroupNumber);
    
    /**
     * @param dispatchOrderId
     * @return
     */
    public TransportCost getTransportCost(Long dispatchOrderId);
    
    /**
     * 
     * @return
     */
    public List<OtherFeeType> listOtherFeeTypes();
    
    /**
     * 
     * @param dispatchOrderId
     * @return
     */
    public Map<Long, OtherFeeInfo> getOtherFeeMappings(Long dispatchOrderId);

    /**
     * get other fee
     * 
     * @param dispatchOrderId
     * @return
     */
    public Object getOtherFee(Long dispatchOrderId);
    
    /**
     * @param dispatchOrderId
     * @param otherFeeTypeId
     * @return
     */
    public Object getOtherFeeDetail(Long dispatchOrderId, Long otherFeeTypeId);
    
    /**
     * @param dispatchOrderId
     * @return
     */
    public String getCarSummary(Long dispatchOrderId);

    /**
     * 
     * @param dispatchOrderId
     * @return
     */
    public DispatchOrderRecord loadDispatchOrderRecord(Long dispatchOrderId);
    
    /**
     * 维护派车单
     * 
     * @param dispatchOrder
     * @param adjustmentDistance
     * @param transportCost
     * @param otherFeeTypeIds
     * @param otherFees
     */
    public void maintain(DispatchOrder dispatchOrder, BigDecimal adjustmentDistance, TransportCost transportCost, List<Long> otherFeeTypeIds, List<BigDecimal> otherFees);
    
    /**
     * disable dispatch_order
     * 
     * @param dispatchOrder
     * @param operator
     */
    public void disableDispatchOrder(DispatchOrder dispatchOrder, Login operator);
    
    /**
     * @param search
     * @return
     */
    public List<Map<String, Object>> exportAll(DispatchOrderReportSearch search);
    
    /**
     * @param search
     * @return
     */
    public List<Map<String, Object>> exportAll(TransOrderReportSearch search);
    
}
